package org.esky.study;

/**
 * 
 * @author Jack.Xu
 * @ClassName: EqualsCompare
 * @Description: equals与== 
 * @author: Jack.Xu
 * @date: 2014年3月5日 上午10:36:25
 */
public class EqualsCompare {

	public static void main(String[] args) {
		Object a = new String("hello");
		Object b = new String("hello");
		Object c = "hello";
		Object d = "hello";
		
		if (a == b) {
			System.out.println("a == b");
		}
		if (a.equals(b)) {
			System.out.println("a.equals(b)");
		}
		if (c == d) {
			System.out.println("c == d");
		}
		if (c.equals(d)) {
			System.out.println("c.equals(d)");
		}
	}

}
